package com.csw;

import java.awt.*;

/**
 * @author A
 * @version 1.0
 * @description: TODO
 * @date 2022/11/27 1:45
 */
public class GameSelect {
    //判断点击到哪个区域.true 点击到  false 未点击到
    boolean hard(){
        if (GameUtil.MOUSE_X>100&&GameUtil.MOUSE_X<400){
                if (GameUtil.MOUSE_Y>50&&GameUtil.MOUSE_Y<150){
                    GameUtil.level=1;
                    GameUtil.state=0;
                    return true;
                }
                if (GameUtil.MOUSE_Y>200&&GameUtil.MOUSE_Y<300){
                    GameUtil.level=2;
                    GameUtil.state=0;
                    return true;
                }
                if (GameUtil.MOUSE_Y>350&&GameUtil.MOUSE_Y<450){
                    GameUtil.level=3;
                    GameUtil.state=0;
                    return true;
                }
                return false;
        }
        return false;
    }


    void paint(Graphics g){
        g.setColor(Color.BLACK);
        g.drawRect(100, 50, 300, 100);
        GameUtil.drawStr(g, 220, 100, 30, Color.red, "简单");
        g.setColor(Color.BLACK);
        g.drawRect(100, 200, 300, 100);
        GameUtil.drawStr(g, 220, 250, 30, Color.red, "普通");
        g.setColor(Color.BLACK);
        g.drawRect(100, 350, 300, 100);
        GameUtil.drawStr(g, 220, 400, 30, Color.red, "困难");
    }
    //方法重载,方法同名,方法返回值和参数不同
    void hard(int level){
        switch (level){
            case 1:
                GameUtil.RAY_MAX=10;
                GameUtil.Map_W=9;
                GameUtil.Map_H=9;
                break;
            case 2:
                GameUtil.RAY_MAX=40;
                GameUtil.Map_W=16;
                GameUtil.Map_H=16;
                break;
            case 3:
                GameUtil.RAY_MAX=70;
                GameUtil.Map_W=30;
                GameUtil.Map_H=16;
                break;
            default:
        }
    }
}
